package cn.edu.zzti.cs.service.student.impl;


import cn.edu.zzti.cs.dao.student.StudentMapper;
import cn.edu.zzti.cs.entity.student.Student;
import cn.edu.zzti.cs.service.student.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceimpl implements StudentService {
    private StudentMapper studentMapper;

    @Autowired
    public void setStudentMapper(StudentMapper studentMapper) {
        this.studentMapper = studentMapper;
    }

    @Override
    public boolean loginAuthenticate(String userNum, String password) {
        Student stu = studentMapper.getByUserNum(userNum);
        if (stu==null){
            return false;
        }
        return password.equalsIgnoreCase(stu.getStuName());
    }
}
